full c:\Oberon\User\Configuration.Mod Romeo:Oberon:User:Configuration.Mod
filename only Configuration.Mod Configuration.Mod
startup directory c:\Oberon\User Romeo:Oberon
current directory c:\Oberon\User Romeo:Oberon:User
parent of current .. ::
relative to current .\Configuration.Mod :Configuration.Mod
relative to parent ..\User\Configuration.Mod ::User:Configuration.Mod
relative to startup $Configuration.Mod $User:Configuration.Mod
FirstIndent1
FirstIndent2
FirstIndent1
FirstIndent1
Text2
FirstIndent1
Text2
FirstIndent1
Text2
FirstIndent1
A Guide to Oberon with Paths and Directories
C. Steindl, Oktober 27 1995
Introduction
Oberon usually supports only a flat directory where all files (*.Mod, *.Obj, *.Tool, *.Text, *.Bak, *.Sym) reside. But you can also arrange your data in directories or in folders.
With this version of Oberon it is possible to:
1) Define paths (directories, folders) in which files are automatically sought, when they shall be opened.
2) Change the current working directory.
In the following we will use the term path, directory or folder synonymously. Each denoting a place on a hard disk where files can be stored. The current working directory is the directory where all files are stored.
Specification of files and directories
You can specify files and directories with pathnames.
A full pathname is a sequence of directory names, separated by a special delimiter character (as defined in Directories.delimiter), starting from the root directory (or volume) and leading down to the file.
A relative pathname is relative to the current working directory or to the startup directory. The startup directory is the current working directory after startup.
Examples:
Startup process under Oberon for Windows
Under Windows, Oberon is started by clicking on an icon. Associated with this icon is the information where the application is located and which directory shall be the working directory. When loaded, Oberon looks for a file called "Oberon.Ini" in the startup directory. This initialization file contains some initial settings including a path variable which denotes a sequence of paths that shall be sought when looking for a file (similar to the DOS environment variable PATH). The initial current working directory (also called the startup directory) is the directory associated with the Oberon-icon as the working directory.
Startup process under Oberon for PowerMac
On a PowerMac, Oberon is started by clicking on the application. If there is a file called "Paths.Text" in the same directory as the application, then the sequence of paths in the the file "Paths.Text" will be sought when looking for a file.
Opening files
Unless you specify a pathname, files are sought
1) in the current working directory
2) in the defined search paths
3) in the startup directory
Storing files
Unless you specify a pathname, new files (including new versions of existing files) are stored in the current working directory.
Commands in module System
Directory (^ | pattern["/"{"d" | "a" | "s" | "n" | "D" | "A" | "S" | "N"}]) lists the directory entries that match the specified pattern.
The following options are possible:
"d" or "D" for date
"s" or "S" for size
"a" or "A" for looking in all paths
"n" or "N" for DOS name (only under Windows)
ChangeDir (^ | name) changes the current working directory to the specified directory.
CreateDir (^ | name) creates the specified directory.
DeleteDir (^ | name) deletes the specified directory.
ParentDir changes the current working directory to the parent directory of the current working directory.
ShowDir displays the current working directory in the log viewer.
StartupDir changes the current working directory to the startup directory.
Module Directories
Exported procedures
Current () returns a directory structure denoting the current working directory.
Startup () returns a directory structure denoting the startup directory.
This (path) returns a directory structure denoting the specified directory.
Change (path) changes the current working directory to the specified directory.
Create (path) creates the specified directory.
Delete (path) deletes the specified directory.
Rename (oldPath, newPath) renames the directory oldPath to newPath.
Enumerate (dir, fileProc) calls fileProc for each entry in the specified directory.
The type FileProc is defined as PROCEDURE (d: Directory; name: ARRAY OF CHAR; isDir: BOOLEAN; VAR continue: BOOLEAN).
isDir is TRUE if the directory entry specified by name is itself a directory.
If the called procedure sets the parameter continue to FALSE, the enumeration process is ended immediately.
EnumeratePaths (pathProc) calls pathProc for each search path.
The type PathProc is defined as PROCEDURE (path: ARRAY OF CHAR; VAR continue: BOOLEAN);
If the called procedure sets the parameter continue to FALSE, the enumeration process is ended immediately.
Exported variables:
res indicates the result of the last directory operation and can be any of the exported values (noErr, badName, mediumFull, mediumLocked, dirInUse, notADir, alreadyExists, and otherError)
notify is a procedure variable which is called whenever a directory entry is inserted or deleted.
The type Notifier is defined as PROCEDURE (op: INTEGER; path, name: ARRAY OF CHAR);
op can be one of the exported values (insert or delete).
path and name specify the inserted/deleted directory entry.
Exported constants:
delimiter is the special character that delimits directory names within a path (e.g. "\" under Windows and ":" under PowerMac).